<form method="post" action="<literal>{:U('')}</literal>" class="ajaxForm" success_url="<literal>{:U(MODULE_NAME.'/</literal>{$TableName}<literal>/all')}</literal>">
    <div class="box box-warning">
        <div class="box-header">
        </div><!-- /.box-header -->
        <div class="box-body">
        	<if condition="count($formFieldArr) AND is_array($formFieldArr)">
        		<php>$ii=0;</php>
        		<foreach name="formFieldArr" item="vvo" key="formkey">
					<volist name="tableInfoArray" id="tableInfo">
						<if condition="$tableInfo[$columnNameKey] neq $primaryKey">
							<if condition="($tableInfo[$columnNameKey] eq $formkey) AND isset($formFieldArr[$tableInfo[$columnNameKey]]) AND isset($formFieldArr[$tableInfo[$columnNameKey]]['inType']) AND in_array($formFieldArr[$tableInfo[$columnNameKey]]['inType'],$inTypeArr) AND (!isset($formFieldArr[$tableInfo[$columnNameKey]]['hidden']) OR (isset($formFieldArr[$tableInfo[$columnNameKey]]['hidden']) AND ($formFieldArr[$tableInfo[$columnNameKey]]['hidden'] neq 1)))">
				        		<div class="form-group sj">
				                    <label>
										<if condition="count($fieldAliasArr) AND isset($fieldAliasArr[$tableInfo[$columnNameKey]]) AND ($fieldAliasArr[$tableInfo[$columnNameKey]] neq '')">
			                                 <eq name="formFieldArr[$tableInfo[$columnNameKey]]['required']" value="1">
                                                  <span style="color:red;">{$fieldAliasArr[$tableInfo[$columnNameKey]]}</span>
			                                 <else/>
			                                      {$fieldAliasArr[$tableInfo[$columnNameKey]]}
			                                 </eq>
										<else/>	
											<if condition="$tableInfo[column_comment] neq ''">
				                                 <eq name="formFieldArr[$tableInfo[$columnNameKey]]['required']" value="1">
	                                                  <span style="color:red;">{$tableInfo[column_comment]}</span>
				                                 <else/>
				                                      {$tableInfo[column_comment]}
				                                 </eq>												
											<else/>
				                                 <eq name="formFieldArr[$tableInfo[$columnNameKey]]['required']" value="1">
	                                                  <span style="color:red;">{$tableInfo[$columnNameKey]}</span>
				                                 <else/>
				                                      {$tableInfo[$columnNameKey]}
				                                 </eq>											 
										    </if>
										</if>							                    	
				                    </label>
									<if condition="isset($formFieldArr[$tableInfo[$columnNameKey]]['inType']) AND ($formFieldArr[$tableInfo[$columnNameKey]]['inType'] neq '')">
										<if condition="$formFieldArr[$tableInfo[$columnNameKey]]['inType'] eq 'text'" >
								            <input type="text" class="form-control" name="{$tableInfo[$columnNameKey]}" id="{$tableInfo[$columnNameKey]}" value="<literal>{$</literal>{$tableName}.{$tableInfo[$columnNameKey]}}" <eq name="formFieldArr[$tableInfo[$columnNameKey]]['required']" value="1">required</eq>/>
								            <notempty name="formFieldArr[$tableInfo[$columnNameKey]]['comments']">
								                 <span class="tip_span" style="display:block;">&nbsp;{$formFieldArr[$tableInfo[$columnNameKey]]['comments']}</span>  
								            </notempty>
								        <elseif condition="$formFieldArr[$tableInfo[$columnNameKey]]['inType'] eq 'number'" />  
								            <input type="number" class="form-control" name="{$tableInfo[$columnNameKey]}" id="{$tableInfo[$columnNameKey]}" value="<literal>{$</literal>{$tableName}.{$tableInfo[$columnNameKey]}}" <eq name="formFieldArr[$tableInfo[$columnNameKey]]['required']" value="1">required</eq> <if condition="isset($formFieldArr[$tableInfo[$columnNameKey]]['min']) && !empty($formFieldArr[$tableInfo[$columnNameKey]]['min'])">min="{$formFieldArr[$tableInfo[$columnNameKey]]['min']}"</if> <if condition="isset($formFieldArr[$tableInfo[$columnNameKey]]['max']) && !empty($formFieldArr[$tableInfo[$columnNameKey]]['max'])">max="{$formFieldArr[$tableInfo[$columnNameKey]]['max']}"</if> <if condition="isset($formFieldArr[$tableInfo[$columnNameKey]]['step']) && !empty($formFieldArr[$tableInfo[$columnNameKey]]['step'])">step="{$formFieldArr[$tableInfo[$columnNameKey]]['step']}"</if>/>								        								     
								            <notempty name="formFieldArr[$tableInfo[$columnNameKey]]['comments']">
								                 <span class="tip_span" style="display:block;">&nbsp;{$formFieldArr[$tableInfo[$columnNameKey]]['comments']}</span>  
								            </notempty>
								        <elseif condition="$formFieldArr[$tableInfo[$columnNameKey]]['inType'] eq 'textarea'" />     
								            <textarea name="{$tableInfo[$columnNameKey]}" id="{$tableInfo[$columnNameKey]}" rows="10" class="form-control" <eq name="formFieldArr[$tableInfo[$columnNameKey]]['required']" value="1">required</eq>><literal>{$</literal>{$tableName}.{$tableInfo[$columnNameKey]}}</textarea>
								            <notempty name="formFieldArr[$tableInfo[$columnNameKey]]['comments']">
								                 <span class="tip_span" style="display:block;">&nbsp;{$formFieldArr[$tableInfo[$columnNameKey]]['comments']}</span>  
								            </notempty>		
								        <elseif condition="$formFieldArr[$tableInfo[$columnNameKey]]['inType'] eq 'select'" /> 
								            <eq name="formFieldArr[$tableInfo[$columnNameKey]]['multiple']" value="1">
									            <select name="{$tableInfo[$columnNameKey]}[]" id="{$tableInfo[$columnNameKey]}" class="form-control select2-list" multiple="multiple" <eq name="formFieldArr[$tableInfo[$columnNameKey]]['required']" value="1">required</eq>> 
				                                    <literal>	
				                                        <volist name=":func_form_select_data('</literal>{$moduleName}<literal>','</literal>{$TableName}<literal>','</literal>{$tableInfo[$columnNameKey]}<literal>')" id="vo">
				                                    </literal>
				                                          <literal><option value="{$key}" <if condition="in_array($key,explode(',',$</literal>{$tableName}[{$tableInfo[$columnNameKey]}<literal>]))">selected="selected"</if>>{$vo}</option></literal>
				                                    <literal>		                                    
				                                        </volist>
				                                    </literal>   
									            </select> 
								            <else/>
									            <select name="{$tableInfo[$columnNameKey]}" id="{$tableInfo[$columnNameKey]}" class="form-control select2-list" <eq name="formFieldArr[$tableInfo[$columnNameKey]]['required']" value="1">required</eq>> 
				                                    <literal>	
				                                        <volist name=":func_form_select_data('</literal>{$moduleName}<literal>','</literal>{$TableName}<literal>','</literal>{$tableInfo[$columnNameKey]}<literal>')" id="vo">
				                                    </literal>
				                                          <literal><option value="{$key}" <if condition="in_array($key,explode(',',$</literal>{$tableName}[{$tableInfo[$columnNameKey]}<literal>]))">selected="selected"</if>>{$vo}</option></literal>
				                                    <literal>		                                    
				                                        </volist>
				                                    </literal>          
									            </select> 
								            </eq>
								            <notempty name="formFieldArr[$tableInfo[$columnNameKey]]['comments']">
								                 <span class="tip_span" style="display:block;">&nbsp;{$formFieldArr[$tableInfo[$columnNameKey]]['comments']}</span>  
								            </notempty>		
								        <elseif condition="$formFieldArr[$tableInfo[$columnNameKey]]['inType'] eq 'radio'" />  
							                <label class="inline">
								                <foreach name="formFieldArr[$tableInfo[$columnNameKey]]['options']" item="vo" key="k">
								                    <input type="radio" name="{$tableInfo[$columnNameKey]}" value="{$k}" <literal><if condition="</literal>{$k}<literal> eq $</literal>{$tableName}[{$tableInfo[$columnNameKey]}<literal>]">checked="checked"</if></literal>/>{$vo}
								                </foreach>  
							                </label> 						                 
								            <notempty name="formFieldArr[$tableInfo[$columnNameKey]]['comments']">
								                 <span class="tip_span" style="display:block;">&nbsp;{$formFieldArr[$tableInfo[$columnNameKey]]['comments']}</span>  
								            </notempty>		
								        <elseif condition="$formFieldArr[$tableInfo[$columnNameKey]]['inType'] eq 'checkbox'" />  
								            <label class="inline">
								                <foreach name="formFieldArr[$tableInfo[$columnNameKey]]['options']" item="vo" key="k"> 
								                    <input type="checkbox" name="{$tableInfo[$columnNameKey]}[]" value="{$k}" <literal><if condition="strpos($</literal>{$tableName}[{$tableInfo[$columnNameKey]}<literal>], '</literal>{$k}<literal>') !== false">checked="checked"</if></literal>>{$vo}
								                </foreach> 
							                </label> 
								            <notempty name="formFieldArr[$tableInfo[$columnNameKey]]['comments']">
								                 <span class="tip_span" style="display:block;">&nbsp;{$formFieldArr[$tableInfo[$columnNameKey]]['comments']}</span>  
								            </notempty>		
								        <elseif condition="$formFieldArr[$tableInfo[$columnNameKey]]['inType'] eq 'file'" /> 
			                                <div class="input-group">
			                                    <input type="text" class="form-control" id="upload{$formFieldArr[$tableInfo[$columnNameKey]]['index']}" name="{$tableInfo[$columnNameKey]}" value="<literal>{$</literal>{$tableName}.{$tableInfo[$columnNameKey]}}" <eq name="formFieldArr[$tableInfo[$columnNameKey]]['required']" value="1">required</eq>/>
			                                    <span class="input-group-btn">
			                                        <button class="btn btn-info btn-flat" type="button" onclick="upImage('{$formFieldArr[$tableInfo[$columnNameKey]]['index']}');">上传</button>
			                                    </span>
			                                </div>	
			                                <literal><if condition="!empty($</literal>{$tableName}[{$tableInfo[$columnNameKey]}<literal>])">                        
			                                  <img src="{$</literal>{$tableName}.{$tableInfo[$columnNameKey]}}<literal>" id="preview</literal>{$formFieldArr[$tableInfo[$columnNameKey]]['index']}<literal>" width="100" height="100"/>
			                                <else/>
			                                  <img src="" id="preview</literal>{$formFieldArr[$tableInfo[$columnNameKey]]['index']}<literal>" width="100" height="100" style="display:none;"/>
			                                </if></literal>	
								            <notempty name="formFieldArr[$tableInfo[$columnNameKey]]['comments']">
								                 <span class="tip_span" style="display:block;">&nbsp;{$formFieldArr[$tableInfo[$columnNameKey]]['comments']}</span>  
								            </notempty>														                                 				        						                
								        <elseif condition="$formFieldArr[$tableInfo[$columnNameKey]]['inType'] eq 'editor'" /> 
											<textarea name="{$tableInfo[$columnNameKey]}" id="{$tableInfo[$columnNameKey]}" style="width: 100%; height: 400px;" <eq name="formFieldArr[$tableInfo[$columnNameKey]]['required']" value="1">required</eq>><literal>{$</literal>{$tableName}.{$tableInfo[$columnNameKey]}}</textarea>
								            <notempty name="formFieldArr[$tableInfo[$columnNameKey]]['comments']">
								                 <span class="tip_span" style="display:block;">&nbsp;{$formFieldArr[$tableInfo[$columnNameKey]]['comments']}</span>  
								            </notempty>		
											<script type="text/javascript">
												$(function() {
												    var editor = new UE.ui.Editor();
												    textarea:'{$tableInfo[$columnNameKey]}';         //与textarea的id值保持一致
												    editor.render('{$tableInfo[$columnNameKey]}');
												});
											</script>
								        <elseif condition="$formFieldArr[$tableInfo[$columnNameKey]]['inType'] eq 'datetime'" /> 
								           <input type="text" name="{$tableInfo[$columnNameKey]}" id="{$tableInfo[$columnNameKey]}" class="form-control jcDate" onclick="SelectDate(this,'yyyy-MM-dd hh:mm:ss')" readonly="readonly" value="<literal>{$</literal>{$tableName}.{$tableInfo[$columnNameKey]}}" <eq name="formFieldArr[$tableInfo[$columnNameKey]]['required']" value="1">required</eq>/>
								            <notempty name="formFieldArr[$tableInfo[$columnNameKey]]['comments']">
								                 <span class="tip_span" style="display:block;">&nbsp;{$formFieldArr[$tableInfo[$columnNameKey]]['comments']}</span>  
								            </notempty>		
									    </if>                             
								    </if>                 	
				                </div>	
			                </if>  
						<else /> 
							<empty name="ii">
								<input type="hidden" name="{$primaryKey}" id="{$primaryKey}" value="<literal>{$</literal>{$tableName}.{$tableInfo[$columnNameKey]}}" />
							</empty>
						</if>
					</volist>
					<php>$ii=$ii+1;</php>
        		</foreach> 
        	</if>	        	

            <div class="box-footer">
                <button type="submit" class="btn btn-primary">提交</button>
            </div>
        </div><!-- /.box-body -->
        
        <div class="overlay hide"></div><div class="loading-img hide"></div>
    </div><!-- /.box -->
</form>